﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiVisualStyle : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiVisualStyle(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiVisualStyle_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiVisualStyle obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiVisualStyle()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiVisualStyle(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiVisualStyle cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiVisualStyle_cast(OdRxObject.getCPtr(pObj));
			OdGiVisualStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiVisualStyle createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiVisualStyle_createObject();
			OdGiVisualStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiVisualStyle Assign(OdGiVisualStyle visualStyle)
		{
			OdGiVisualStyle result = (OdGiVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_Assign(this.swigCPtr, OdGiVisualStyle.getCPtr(visualStyle)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGiVisualStyle visualStyle)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_IsEqual(this.swigCPtr, OdGiVisualStyle.getCPtr(visualStyle));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiFaceStyle faceStyle()
		{
			OdGiFaceStyle result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_faceStyle__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiEdgeStyle edgeStyle()
		{
			OdGiEdgeStyle result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_edgeStyle__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiDisplayStyle displayStyle()
		{
			OdGiDisplayStyle result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiVisualStyle_displayStyle__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setFaceStyle(OdGiFaceStyle style)
		{
			GlobalsPINVOKE.OdGiVisualStyle_setFaceStyle(this.swigCPtr, OdGiFaceStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setEdgeStyle(OdGiEdgeStyle style)
		{
			GlobalsPINVOKE.OdGiVisualStyle_setEdgeStyle(this.swigCPtr, OdGiEdgeStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setDisplayStyle(OdGiDisplayStyle style)
		{
			GlobalsPINVOKE.OdGiVisualStyle_setDisplayStyle(this.swigCPtr, OdGiDisplayStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void configureForType(OdGiVisualStyle.Type type)
		{
			GlobalsPINVOKE.OdGiVisualStyle_configureForType(this.swigCPtr, (int)type);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool setType(OdGiVisualStyle.Type type)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setType(this.swigCPtr, (int)type);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiVisualStyle.Type type()
		{
			OdGiVisualStyle.Type result = (OdGiVisualStyle.Type)GlobalsPINVOKE.OdGiVisualStyle_type(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_0(this.swigCPtr, (int)prop, (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, OdGiVariant pVal, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_1(this.swigCPtr, (int)prop, OdGiVariant.getCPtr(pVal), (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, OdGiVariant pVal)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_2(this.swigCPtr, (int)prop, OdGiVariant.getCPtr(pVal));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, int nVal, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_3(this.swigCPtr, (int)prop, nVal, (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, int nVal)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_4(this.swigCPtr, (int)prop, nVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, bool bVal, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_5(this.swigCPtr, (int)prop, bVal, (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, bool bVal)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_6(this.swigCPtr, (int)prop, bVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, double dVal, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_7(this.swigCPtr, (int)prop, dVal, (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, double dVal)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_8(this.swigCPtr, (int)prop, dVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, double red, double green, double blue, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_9(this.swigCPtr, (int)prop, red, green, blue, (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, double red, double green, double blue)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_10(this.swigCPtr, (int)prop, red, green, blue);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, OdCmColorBase pColor, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_11(this.swigCPtr, (int)prop, OdCmColorBase.getCPtr(pColor), (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, OdCmColorBase pColor)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_12(this.swigCPtr, (int)prop, OdCmColorBase.getCPtr(pColor));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, OdCmEntityColor pColor, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_13(this.swigCPtr, (int)prop, OdCmEntityColor.getCPtr(pColor), (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, OdCmEntityColor pColor)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_14(this.swigCPtr, (int)prop, OdCmEntityColor.getCPtr(pColor));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, string pStr, Operation op)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_15(this.swigCPtr, (int)prop, pStr, (int)op);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTrait(Property prop, string pStr)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTrait__SWIG_16(this.swigCPtr, (int)prop, pStr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiVariant trait(Property prop, SWIGTYPE_p_OdGiVisualStyleOperations__Operation pOp)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiVisualStyle_trait__SWIG_0(this.swigCPtr, (int)prop, SWIGTYPE_p_OdGiVisualStyleOperations__Operation.getCPtr(pOp));
			OdGiVariant result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiVariant trait(Property prop)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiVisualStyle_trait__SWIG_1(this.swigCPtr, (int)prop);
			OdGiVariant result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual Operation operation(Property prop)
		{
			Operation result = (Operation)GlobalsPINVOKE.OdGiVisualStyle_operation(this.swigCPtr, (int)prop);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTraitFlag(Property flagProp, uint flagVal, bool bEnable)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTraitFlag__SWIG_0(this.swigCPtr, (int)flagProp, flagVal, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setTraitFlag(Property flagProp, uint flagVal)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_setTraitFlag__SWIG_1(this.swigCPtr, (int)flagProp, flagVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool traitFlag(Property flagProp, uint flagVal)
		{
			bool result = GlobalsPINVOKE.OdGiVisualStyle_traitFlag(this.swigCPtr, (int)flagProp, flagVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiVariant.VariantType propertyType(Property prop)
		{
			OdGiVariant.VariantType result = (OdGiVariant.VariantType)GlobalsPINVOKE.OdGiVisualStyle_propertyType((int)prop);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum Type
		{
			kFlat,
			kFlatWithEdges,
			kGouraud,
			kGouraudWithEdges,
			k2DWireframe,
			k3DWireframe,
			kHidden,
			kBasic,
			kRealistic,
			kConceptual,
			kCustom,
			kDim,
			kBrighten,
			kThicken,
			kLinePattern,
			kFacePattern,
			kColorChange,
			kFaceOnly,
			kEdgeOnly,
			kDisplayOnly,
			kJitterOff,
			kOverhangOff,
			kEdgeColorOff,
			kShadesOfGray,
			kSketchy,
			kXRay,
			kShadedWithEdges,
			kShaded,
			kByViewport,
			kByLayer,
			kByBlock,
			kEmptyStyle
		}
	}
}
